package com.ultrasoft.farmasoft.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.ultrasoft.farmasoft.domain.Activesubstance;
import com.ultrasoft.farmasoft.domain.Attribute;
import com.ultrasoft.farmasoft.domain.Composition;
import com.ultrasoft.farmasoft.domain.Genericvalue;
import com.ultrasoft.farmasoft.domain.Pharmacy;
import com.ultrasoft.farmasoft.domain.Product;
import com.ultrasoft.farmasoft.domain.Productattribute;
import com.ultrasoft.farmasoft.domain.Productattributes;
import com.ultrasoft.farmasoft.domain.Provider;
import com.ultrasoft.farmasoft.domain.Providerpharmacy;
import com.ultrasoft.farmasoft.domain.Typecomposition;

public interface ConfigServiceProducts {

	//Type Of Composition
	public List<Typecomposition> getTypecompositionList();
    public void addTypeComposition(Typecomposition typecomposition);
    public void removeTypeComposition(Typecomposition typecomposition);  
    public void updateTypeComposition(Typecomposition typecomposition);  
	public Typecomposition searchTypecompositionByID(Integer idTypeComposition);


	// Active Substance
	public Integer getSubstanceActiveId();
	public void saveSubstanceActive(Activesubstance activesubstance)throws Exception;
	public List<Activesubstance> getActivesubstanceList();
    public void addActiveSubstance(Activesubstance activesubstance);
    public void removeActiveSubstance(Activesubstance activesubstance);  
    public void updateActiveSubstance(Activesubstance activesubstance);  
	public Activesubstance searchActivesubstanceByID(Integer idActiveSubstance);
	
	
	// Attribute
	public List<Attribute> getAttribute();
	public List<Attribute> getAttributeListByActiveSubstanceId(Integer idActiveSubstance);
	public Attribute searchAttributeByIDActiveSubstanceAndIDAttribute(Integer idAttribute,Integer idActiveSubstance);
	public Attribute searchAttributeByID(Integer idAttribute);
	public Integer getAttributeId();
	public void addAttribute(Attribute attribute);
    public void updateAttribute(Attribute attribute);  
    public void removeAttribute(Attribute attribute);
	
    
    
    
    
    
    public List<Provider> getListProvider(Integer pharmacyId,boolean active);
    public List<Provider> getListProvider(boolean active);
	public Provider searchProviderByProviderId(Integer providerId);
	public void addProvider(Provider provider);
    public void updateProvider(Provider provider);
	public Integer searchProviderIdByProviderIdMax();

	
	public List<Providerpharmacy> getListProviderPharmacyByPharmacyId(Integer pharmacyId, boolean active);
	public void addProviderPharmacy(Providerpharmacy providerPharmacy);
	public Providerpharmacy searchProviderPharmacy(Integer pharmacyId, Integer providerId);

	
	public Pharmacy searchPharmacyByPharmacyId(Integer pharmacyId);
	
	
    public List<Composition> getListComposition();
	public List<Composition> getListComposition(Integer compositionId,boolean active);
	public List<Composition> getListCompositionByProviderIdByProductIdByActive(Integer providerId,Integer productId,boolean active);
    public Composition searchCompositionByCompositionId(Integer compositionId);
    public void removeComposition(Integer providerId,Integer productId);
    public void removeComposition(Composition composition);  
    public void updateComposition(Composition composition); 
    public void addComposition(Composition composition);
      
    
    public List<Productattribute> getListProductAttribute();
    public Productattribute searchProductAttributeByProductAttributeId(Integer productAttributeId); 
	public void removeProductAttribute(Productattribute productAttribute);
    public void updateProductAttribute(Productattribute productAttribute);    
    public void addProductAttribute(Productattribute productAttribute);
    
    public List<Product> getListProduct();
	public List<Product> getListProduct(boolean active);
	public List<Product> getListProductByActiveSubstanceId(Integer activesubstanceId);
	public List<Product> getListProductByPharmacyId(Integer pharmacyId,boolean active);
	public List<Product> getListProductByPharmacyIdByProviderId(Integer pharmacyId,Integer providerId ,boolean active);
	public List<Product> getListProductByPharmacyIdByActiveByStockId(Integer pharmacyId,boolean active,Integer stockId);
	//public List<Product> getListProductByPharmacyIdByActiveByStockIdByState(Integer pharmacyId,boolean active,Integer stockId,short statePackage,short stateItem);
	public List<Product> getListProductByPharmacyIdByActiveByStockIdByName(Integer pharmacyId,boolean active,Integer stockId,String name);
	public List<Product> getListProductByPharmacyIdByActiveByStockIdByCode(Integer pharmacyId,boolean active,Integer stockId,String code);
	public List<Product> getListProductByPharmacyIdByActiveByStockIdByCodeBar(Integer pharmacyId,boolean active,Integer stockId,String codeBar);
	public List<Product> getListProductByPharmacyIdComplete(Integer pharmacyId,boolean active);
	public void setFreeItemsFreePackageToProductByPharmacyIdByTempStateByActive(Integer pharmacyId,short tempState,boolean active);
	public List<Product> getListProductByPharmacyIdCompleteByState(Integer pharmacyId,boolean active,short state);
	public List<Product> getListProductByPharmacyIdByProviderCompleteByState(Integer pharmacyId,Integer providerId,boolean active,short state);
	public List<Product> getListProductByPharmacyIdByActiveByName(Integer pharmacyId,boolean active,String name);
	public List<Product> getListProductByPharmacyIdByproviderIdByActiveByName(Integer pharmacyId,Integer providerId,boolean active,String name);
	public List<Product> getListProductByPharmacyIdByproviderIdByActiveByCode(Integer pharmacyId,Integer providerId,boolean active,String code);
	public List<Product> getListProductByPharmacyIdByproviderIdByActiveByCodeBar(Integer pharmacyId,Integer providerId,boolean active,String codeBar);
	public List<Product> getListProductByproviderId(Integer providerId,boolean active);
	public List<Product> getListProductByproductId(Integer productId,boolean active);
	//public Product searchProductByProviderIdByProductId(Integer providerId,Integer productId,Integer pharmacyId,boolean active,Integer stockId,short statePackage,short stateItem);
	public Product searchProductByProviderIdByProductId(Integer providerId,Integer productId,Integer pharmacyId,boolean active,Integer stockId);
	public Product searchProductByProviderIdByProductId(Integer providerId,Integer productId);	
	public Product searchProductByPharmacyIdByProviderIdByProductId(Integer pharmacyId,Integer providerId,Integer productId);
    public void updateProduct(Product product);
	public void addProduct(Product product);
	public Integer searchProductByProductIdMax();
	
	public List<Genericvalue> getListGenericValueByPharmacyIdByGroup(Integer pharmacyId,Short group);
	
	public List<Productattributes> getListProductAttributes();
	public List<Productattributes> getListProductAttributesByProviderId(Integer providerId);
	public List<Productattributes> getListProductAttributesByProductId(Integer productId);
	public List<Productattributes> getListProductAttributesByProductAttributeId(Integer productAttributeId);
	public List<Productattributes> getListProductAttributesByProviderIdByProductId(Integer providerId,Integer productId);
	public Productattributes searchProductAttributesByProviderIdByProductIdByProductAttributeId(Integer providerId,Integer productId,Integer productAttributeId);				
	public void removeProductAttributes(Integer providerId,Integer productId);
	public void updateProductAttributes(Productattributes productAttributes);
	public void addProductAttributes(Productattributes productAttributes);
}